<% content_for :page_title do %>
  <%= t(:listing_slideshows) %>
<% end %>

<% content_for :page_actions do %>
  <div class="toolbar" data-hook="toolbar">
    <ul class="actions header-action-links inline-menu">
      <li id="new_slideshow_link">
        <%= button_link_to t(:new_slideshow), new_object_url, { :remote => true, :icon => 'icon-plus', :id => 'admin_new_slideshow' } %>
      </li>
    </ul>
  </div>
<% end %>

<%= render :partial => 'spree/admin/shared/slideshow_sub_menu' %>

<div id="new_slideshow" data-hook></div>

<% if @collection.any? %>
	<table class="index" id="listing_slideshows">
		<colgroup>
		<col style="width: 55%;">
		<col style="width: 10%;">
		<col style="width: 17%;">
		</colgroup>
		<thead>
			<tr data-hook="admin_slideshows_index_headers">
				<th><%= t(:category) %></th>
				<th><%= t(:enabled) %></th>
				<th data-hook="admin_slideshows_index_header_actions" class="actions"></th>
			</tr>
		</thead>
		<tbody>
		<% @slideshows.each do |slideshow| %>
		<tr id="<%= spree_dom_id slideshow %>" data-hook="admin_slideshows_index_rows" class="<%= cycle('odd', 'even') %>">
			<td><%= slideshow.category %> (<%= slideshow.slides.count %> <%= t(:slides) %>)</td>
			<td align="center"><%= icon('icon-check icon-large') if slideshow.enabled %></td>
			<td class="actions" data-hook="admin_slideshows_index_row_actions">
				<%= link_to_edit slideshow, :no_text => true, :class => 'edit' %>
				&nbsp;
				<%= link_to_delete slideshow, :no_text => true %>
			</td>
		</tr>
		<% end %>
		</tbody>
	</table>
<% else %>
	<div class="no-objects-found">
		<%= t(:no_results) %>
	</div>
<% end %>
